import request from '@/utils/request'

// 分页查询用户列表接口
export const FindUserPage = (pageNum, pageSize, searchObj) => {
  return request({
    url: `/admin/system/user/page/${pageNum}/${pageSize}`,
    method: 'GET',
    // {keyword:xx , createTimeStart:xxx}
    params: searchObj,
  })
}
//批量删除用户
export const BatchDeleteUser = ids => {
  return request({
    url: `/admin/system/user/batchDel`,
    method: 'DELETE',
    data: ids,
  })
}
//删除用户
export const DeleteUser = id => {
  return request({
    url: `/admin/system/user/${id}`,
    method: 'DELETE',
  })
}
//新增用户
export const SaveUser = data => {
  return request({
    url: `/admin/system/user/save`,
    method: 'POST',
    //请求体传参：
    data,
  })
}
//根据id查询用户
export const GetUserById = id => {
  return request({
    url: `/admin/system/user/${id}`,
    method: 'GET',
  })
}
//更新用户
export const UpdateUser = data => {
  return request({
    url: `/admin/system/user/update`,
    method: 'PUT',
    //请求体传参： 要保存的角色json对象
    data,
  })
}
